import Store from 'electron-store'

const store = new Store()

export const init = (type: string) => {
  store.set(`${type}`, {})
}
export const set = (name: string, type: string, data: any) => {
  store.set(`${type}.${name}`, data)
}

export const get = (name: string, type: string) => {
  return store.get(`${type}.${name}`)
}

export const getList = (type: string) =>{
  return store.get(type)
}

export const del = (name: string, type: string) => {
  return store.delete(`${type}.${name}`)
}
